[mirrors]
http://poppler.freedesktop.org/poppler-0.24.4.tar.xz

[main]
filesize=1511248
sha512=5567a51c2d2311ceaae087a7f7d5c0b71ba90afa91184a41997b3ea76aeff6d5b182d7c4018a1c2e93eb15b1f6cfec783b326940797ad4d5b7ee0276008b06db

[deps.host]
pkgconf

[deps]
libx11
libtiff
libjpeg
libpng
freetype
fontconfig
cairo
glib

[build]
patch -p1 < "$K"/poppler-segfault.patch
# https://bugs.freedesktop.org/show_bug.cgi?id=12925

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --enable-introspection=no \
  --enable-cms=none \
  --disable-gtk-test \
  --disable-poppler-qt4 \
  --disable-poppler-qt5 \
  --disable-splash-output \
  --disable-libopenjpeg \
  --enable-xpdf-headers \
  --enable-zlib
[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"
make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
